import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

Widget HiChip(Text label, {VoidCallback onClick, SvgPicture avatar, Color color, bool outline}) {
  if (color == null) color = Colors.grey[50];
  BoxDecoration dec = BoxDecoration(color: color, borderRadius: BorderRadius.circular(16));
  if (outline!=null && outline) dec = BoxDecoration(border: Border.all(width: 1, color: color), borderRadius: BorderRadius.circular(16));
  return GestureDetector(onTap: onClick, child: Container(
    decoration: dec,
    padding: EdgeInsets.only(left: 5,right: 5,top: 2,bottom: 2),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.center,
      mainAxisSize: MainAxisSize.min,
      children: avatar != null?[
        Padding(padding: EdgeInsets.only(right: 2), child: avatar),
        label,
      ]:[label],
    ),
  ));
}